<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>clientXclentY</title>
</head>
<body>
<div style="width: 500px;height: 500px;border: 1px solid red;"></div>
</body>
<script>
    document.querySelector('div').onclick = function (ev) {
        const x = ev.clientX
        const y = ev.clientY
        console.log(x,y)
    }
</script>
</html>